const app = getApp()

Page({
  data: {
    tools: [{
        img: "http://img.mmifx.com/miniapp/card.png",
        name: "租车",
        bindurl: "tools/card",
      }, {
        img: "http://img.mmifx.com/miniapp/zhu.png",
        name: "食住",
        bindurl: "tools/zhu",
      }, {
        img: "http://img.mmifx.com/miniapp/lubiao.png",
        name: "精品路线",
        bindurl: "tools/customroute",
      }, {
        img: "http://img.mmifx.com/miniapp/anquan.png",
        name: "安全管家",
        bindurl: "tools/guanjia",
      }, {
        img: "http://img.mmifx.com/miniapp/club.png",
        name: "俱乐部",
        bindurl: "tools/club",
      }, {
        img: "http://img.mmifx.com/miniapp/daoyou.png",
        name: "向导",
        bindurl: "tools/club",
      },
      {
        img: "http://img.mmifx.com/miniapp/qinzi.png",
        name: "亲子游",
        bindurl: "tools/qinzi",
      }, {
        img: "http://img.mmifx.com/miniapp/lubiao.png",
        name: "云游",
        bindurl: "tools/yun",
      }
    ],
    playList: [{
      img: "http://img.mmifx.com/miniapp/20210606195722.jpg",
      title: "亲子时光",
      content: "让世界充满父爱与母爱"
    }, {
      img: "http://img.mmifx.com/miniapp/20210609165804.jpg",
      title: "红色主路",
      content: "党史在路上主题短视频"
    }, {
      img: "http://img.mmifx.com/miniapp/20210609165727.jpg",
      title: "环巢湖",
      content: "寻找古人的秘密"
    }, {
      img: "http://img.mmifx.com/miniapp/zhaolei.jpeg",
      title: "寻找赵雷",
      content: "草莓音乐节自驾相约合肥"
    }],
    adList: [{
      id: 0,
      img: "http://img.mmifx.com/miniapp/20210701212343.jpg"
    }, {
      id: 1,
      img: "http://img.mmifx.com/miniapp/20210701212457.png"
    }, {
      id: 2,
      img: "http://img.mmifx.com/miniapp/20210701212525.png"
    }, {
      id: 3,
      img: "http://img.mmifx.com/miniapp/20210701212607.png"
    }, {
      id: 4,
      img: "http://img.mmifx.com/miniapp/20210701212626.png"
    }],
    anquanshow: false,
    isActive: true
  },
  GoPage: function () {
    wx.showModal({
      title: "操作提醒",
      content: "正在路上..."
    })
  },
  GoCarMark() {
    wx.navigateTo({
      url: "/pages/zuche/zuche"
    })
  },
  // 前往食住
  GoFood() {
    wx.navigateTo({
      url: "/pages/food/food"
    })
  },
  // 前往精品路线
  GoRoute() {
    wx.navigateTo({
      url: "/pages/route/route"
    })

  },
  // 前往俱乐部
  GoClub() {
    wx.navigateTo({
      url: "/pages/club/club"
    })

  },
  // 向导
  GoXiangdao() {
    wx.navigateTo({
      url: "/pages/xiangdao/xiangdao"
    })

  },
  // 前往亲子游
  GoQinzi() {
    wx.navigateTo({
      url: "/pages/qinzi/qinzi"
    })

  },
  // 直播 
  GoVideo() {
    wx.navigateTo({
      url: "/pages/livevideo/livevideo"
    })

  },
  AnQuanTap() {
    let that = this;
    that.setData({
      anquanshow: !that.data.anquanshow
    })
  },
  Gopark() {
    wx.navigateTo({
      url: "/pages/park/park"
    })
  },

  GoHelp() {
    wx.navigateTo({
      url: "/pages/jiuyuan/jiuyuan"
    })
  },
  GoKefu() {
    wx.navigateTo({
      url: "/pages/kefu/kefu"
    })
  },
  Goradio() {
    wx.navigateTo({
      url: "/pages/music/music"
    })
  },

  GoPhone() {
    wx.showModal({
      title: '提示',
      content: '5s后将进行自动呼救！',
      showCancel: false,
      confirmText: "取消",
      success(res) {
        if (res.confirm) {
          return false
        }
      }
    })
  },
  cancelAnquan() {
    this.setData({
      anquanshow: false
    })
  },

  CheckActive() {
    let that = this;
    wx.request({
      url: "https://wx.mmifx.com/zjy/info.json?t=" + Math.random(),
      success(res) {
        console.log(res.data);
        that.setData({
          isActive: res.data.show
        })
      }
    })
  },
  onLoad() {
    // this.CheckActive()
    // console.log("sdaasd");
  },

})